package com.stedu.mall.common.service;

import com.github.pagehelper.PageInfo;
import com.stedu.mall.common.bean.Goods;
import com.stedu.mall.common.exception.SteduException;

import java.util.List;
import java.util.Map;

public interface GoodsService {
    //添加
    void insert(Goods goods) throws SteduException;
    //根据id删除
    void delete(Integer id) throws SteduException;
    //根据id修改
    void update(Goods goods) throws SteduException;
    //根据id查询
    Goods selectById(Integer id);
    //搜索分页
    PageInfo<Goods> selectByCondition(Goods condition, Integer pageNum, Integer pageSize);
    //根据条件查询 - 注意：分类id可能是父分类id，也可能是子分类id
    PageInfo<Goods> selectByCondition1(Goods condition, Integer pageNum, Integer pageSize);
    //查询前5数量最高的商品
    List<Goods> selectByFive();

    List<Map<String, Object>> selectAllCnameAndCount();
}
